package timing.ukulele.seal.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.TopicExchange;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class TopicConfig {
    // 印章抠图
    public static final String SEAL_CROP_CHANNEL = "seal_crop_channel";
    public static final String SEAL_CROP_ROUTING = "seal_crop.routing";

    @Bean
    public Queue sealCropQueue() {
        return new Queue(SEAL_CROP_ROUTING);
    }

    @Bean
    public TopicExchange sealCropExchange() {
        return new TopicExchange(SEAL_CROP_CHANNEL);
    }

    @Bean
    public Binding bindSealCropExchange(Queue sealCropQueue, TopicExchange sealCropExchange) {
        return BindingBuilder.bind(sealCropQueue).to(sealCropExchange).with(SEAL_CROP_ROUTING);
    }
}
